import fetch from "@/api";

export function getShipPlan(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan`,
        params
    })
}

export function getJobtrace(params) {
    return fetch({
        method: 'get',
        url: `/jobtrace`,
        params
    })
}

export  function batchModSealInfo(data) {
    return fetch({
        method: 'post',
        url: `/shipPlan/batchModSealInfo`,
        data
    })
}

export function addShipPlan(data) {
    return fetch({
        method: 'post',
        url: `/shipPlan`,
        data
    })
}

export function editShipPlan(id, data) {
    return fetch({
        method: 'put',
        url: `/shipPlan/${id}`,
        data
    })
}

export function deleteShipPlan(id) {
    return fetch({
        method: 'delete',
        url: `/shipPlan/${id}`,
    })
}

export function getShipPlanId(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/${id}`,
    })
}

export function getCanDevanClose(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/getCanDevanClose`,
        params
    })
}

export function getShipPlanIdList(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/${id}/list`,
        params
    })
}

// 新增
export function addShipPlanList(id, data) {
    return fetch({
        method: 'post',
        url: `/shipPlan/${id}/list`,
        data
    })
}

// 编辑
export function editShipPlanList(id, data) {
    return fetch({
        method: 'put',
        url: `/shipPlan/${id}/list`,
        data
    })
}

export function deleteShipPlanList(id) {
    return fetch({
        method: 'delete',
        url: `/shipPlan/${id}/list`,
    })
}

// 计划统计-内外贸
export function shipPlanTradeType(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/plan/${id}/tradeType`,
        params
    })
}

// 报告-内外贸
export function shipPlanTradeTypeReport(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/tradeType`,
        params
    })
}

// 计划统计-中转
export function shipPlanTransfer(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/plan/${id}/transfer`,
        params
    })
}

// 报告-中转
export function shipPlanTransferReport(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/transfer`,
        params
    })
}

// 计划统计-船代
export function shipPlanShipAgent(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/plan/${id}/agentName`,
        params
    })
}

// 报告-船代
export function shipPlanShipAgentReport(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/agentName`,
        params
    })
}

// 装箱方式
export function shipPlanEnchaseWay(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/enchaseWay`
    })
}

// 报告详情
export function shipPlanSummary(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/summary`
    })
}

// 明细报告
export function shipPlanDetail(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/detail`,
        params
    })
}

// 明细报告打印
export function printingDetail(id, params) {
    return fetch({
        method: 'get',
        url: `/printing/report/${id}/detail`,
        params
    })
}

// 账单ID明细报告
export function balanceDetail(id, params) {
    return fetch({
        method: 'get',
        url: `/printing/accountBill/${id}`,
        params
    })
}

// 残损报告
export function shipPlanDamaged(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/damaged`,
        params
    })
}

// 港装报告
export function shipPlanPort(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/port`,
        params
    })
}

//  -----外理封航-----
//  作业汇总比对
export function getCloseContrast(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/sealed/contrast/${id}`
    })
}

// 外理封航分页
export function getSureClose(id, params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/sealed/${id}`,
        params
    })
}

// 外理封航-计划信息
export function getClosePlanInfo(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/sealed/planInfo/${id}`
    })
}

// 发送EDI
export function shipPlanSealedEdi(data) {
    return fetch({
        method: 'post',
        url: `/shipPlan/sealed/edi`,
        data
    })
}

// 确认封航
export function confirmClose(id, data) {
    return fetch({
        method: 'post',
        url: `/shipPlan/sealed/confirm/${id}`,
        data
    })
}

// 退回作业
export function returnClose(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/sealed/return/${id}`,
    })
}

// 查看理箱记录
export function getTallyRecord(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/close/${id}`
    })
}

// 修改理箱记录
export function putTallyRecord(id, data) {
    return fetch({
        method: 'put',
        url: `/shipPlan/close/${id}`,
        data
    })
}

// 查看拆提放行记录
export function getFeeCloseRecord(params) {
    return fetch({
        method: 'get',
        url: `/shipTally/release/list`,
        params
    })
}

// 拆提放行查看
export function shipTallyReleaseId(id) {
    return fetch({
        method: 'get',
        url: `/shipTally/release/${id}`,
    })
}

// 月结撤销
export function getFeeCloseCancelM(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/release/cancel`,
        data,
    })
}

// 现结撤销
export function feeCloseCancelC(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/release/cancel`,
        data
    })
}

// 箱选择
export function getBoxSelect(params) {
    return fetch({
        method: 'get',
        url: `/shipTally/boxChoice`,
        params
    })
}

// 提单号选择
export function getBillSelect(params) {
    return fetch({
        method: 'get',
        url: `/shipTally/billNumber`,
        params
    })
}

// 确认提单号选择
export function sureBillSelect(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/billNumber/confirm`,
        data
    })
}

// 确认拆提放行
export function sureFeeClose(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/feeConfirm`,
        data
    })
}

// 拆提放行结算
export function releaseCount(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/release/count`,
        data
    })
}

// 拆箱结算
export function releaseCountCX(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/release/countcx`,
        data
    })
}

// 拆提结算
export function getCashMoney(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/modify/getCashMoney`,
        data
    })
}

// 调整放行类型
export function changeDevanType(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/modify/devanType`,
        data
    })
}

// 调整付费单位
export function changePayUnit(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/dismantling/payunit`,
        data
    })
}

// 拆提封航
export function postFeeClose(id, data) {
    return fetch({
        method: 'post',
        url: `/shipPlan/feeConfirm/${id}`,
        data
    })
}

// 特殊结算
export function getSpecialNum(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/special/count`,
        data
    })
}

export function postFeeConfirm(data) {
    return fetch({
        method: 'post',
        url: `/shipTally/special/feeConfirm`,
        data
    })
}

export function cancelSpecial(id, data) {
    return fetch({
        method: 'post',
        url: `/shipTally/special/cancel/${id}`,
        data
    })
}


// 首页-饼状图
export function getShipPlanPie(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/pie`,
        params
    })
}

// 首页-进度条-船计划
export function getProgressPlan(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/progress/plan`,
        params
    })
}

// 首页-进度条-箱作业
export function getProgressWork(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/progress/work`,
        params
    })
}


// 首页-进度条-封航
export function getProgressClose(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/progress/close`,
        params
    })
}

// 首页-月历
export function getShipPlanCalendar(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/calendar`,
        params
    })
}


// 汇总报告-打印
export function printTotal(params) {
    return fetch({
        method: 'get',
        url: `/printing/report`,
        params
    })
}

// 积载图
export function getStowage(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/report/${id}/Stowage`,
    })
}

// 箱号历史记录
export function getHistoryContainer(params) {
    return fetch({
        method: 'get',
        url: `/shipTally/container`,
        params
    })
}

// 货名历史记录
export function getHistoryCargoName(params) {
    return fetch({
        method: 'get',
        url: `/shipTally/cargoName`,
        params
    })
}

// 通过用户ID查询作业班组
export function getWorkTeamUserId(params) {
    return fetch({
        method: 'get',
        url: `/printing/workTeam`,
        params
    })
}

// 通过用户ID查询作业人员
export function getWorkUserId(params) {
    return fetch({
        method: 'get',
        url: `/printing/jobPerson`,
        params
    })
}

// 查询船名-航次
export function getShipVoyage(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan`,
        params
    })
}

//查询船名-航次(new)
export function getShipVoyageNew(params) {
    return fetch({
        method: 'get',
        url: `/shipPlan/getShipVoyage`,
        params
    })
}

export function getShipTallyContainer(params) {
    return fetch({
        method: 'get',
        url: `shipTally/close/container`,
        params
    })
}

export function shipPlanInport(id, data) {
    return fetch({
        method: 'post',
        url: `shipPlan/${id}/inport`,
        data
    })
}

// 理货作业日报
export function getDayReport(params) {
    return fetch({
        method: 'get',
        url: `/report/getPlanListByMonth`,
        params
    })
}

// 理货作业日报(装卸船理箱统计)
export function getDayReportZX(params) {
    return fetch({
        method: 'get',
        url: `/report/getPlanCountByType`,
        params
    })
}

// 理货作业日报(装/拆/提箱统计)
export function cargoplancount(params) {
    return fetch({
        method: 'get',
        url: `/report/cargoplancount/shipAgent`,
        params
    })
}

// 理货作业日报(装拆箱作业统计)
export function getDayReportCX(params) {
    return fetch({
        method: 'get',
        url: `/report/getCargoCountByType`,
        params
    })
}

// 装/卸船理箱-船代统计
export function getDayReportCD(params) {
    return fetch({
        method: 'get',
        url: `/report/statistics/shipAgent`,
        params
    })
}

// 理货作业月报（理箱）
export function getMonthReport(params) {
    return fetch({
        method: 'get',
        url: `/report/plan/month`,
        params
    })
}

// 理货作业月报(艘次)
export function getMonthReportV(params) {
    return fetch({
        method: 'get',
        url: `/report/month/voyage`,
        params
    })
}

// 理货作业月报(拆装箱)
export function getMonthReportC(params) {
    return fetch({
        method: 'get',
        url: `/report/month/cargo`,
        params
    })
}

// 理货作业月报统计大表(装箱)
export function getMonthTabRepZX(params) {
    return fetch({
        method: 'get',
        url: `/report/reportForm/packing`,
        params
    })
}

// 理货作业月报统计大表(装箱)同比
export function getMonthTabRepZXTB(params) {
    return fetch({
        method: 'get',
        url: `/report/same/packing`,
        params
    })
}

// 理货作业月报统计大表(装箱)环比
export function getMonthTabRepZXHB(params) {
    return fetch({
        method: 'get',
        url: `/report/ringRatio/packing`,
        params
    })
}

// 理货作业月报统计大表(拆箱)
export function getMonthTabRepCX(params) {
    return fetch({
        method: 'get',
        url: `/report/reportForm/unbox`,
        params
    })
}

// 理货作业月报统计大表(拆箱)同比
export function getMonthTabRepCXTB(params) {
    return fetch({
        method: 'get',
        url: `/report/same/unbox`,
        params
    })
}

// 理货作业月报统计大表(拆箱)环比
export function getMonthTabRepCXHB(params) {
    return fetch({
        method: 'get',
        url: `/report/ringRatio/unbox`,
        params
    })
}

// 理货作业月报统计大表(进出口)
export function getMonthTabRepIO(params) {
    return fetch({
        method: 'get',
        url: `/report/reportForm`,
        params
    })
}

// 理货作业月报统计大表(进出口)同比
export function getMonthTabRepIOTB(params) {
    return fetch({
        method: 'get',
        url: `/report/same/reportForm`,
        params
    })
}

// 结算单位统计大表(进出口)同比
export function getAccountunitTabRep(params) {
    return fetch({
        method: 'get',
        url: `/report/month/accountunit`,
        params
    })
}

// 理货作业月报统计大表(进出口)环比
export function getMonthTabRepIOHB(params) {
    return fetch({
        method: 'get',
        url: `/report/ringRatio/reportForm`,
        params
    })
}

// 理货作业月报统计大表(特殊作业)
export function getMonthTabRepSP(params) {
    return fetch({
        method: 'get',
        url: `/report/reportForm/special`,
        params
    })
}

// 理货作业月报统计大表(特殊作业)同比
export function getMonthTabRepSPTB(params) {
    return fetch({
        method: 'get',
        url: `/report/same/special`,
        params
    })
}

// 理货作业月报统计大表(特殊作业)环比
export function getMonthTabRepSPHB(params) {
    return fetch({
        method: 'get',
        url: `/report/ringRatio/special`,
        params
    })
}

// 二期查询相关
export function getZcPage(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/speed`,
        params
    })
}

export function getZcCount(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/speed/count`,
        params
    })
}

export function getXcPage(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/speed`,
        params
    })
}

export function getXcCount(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/speed/count`,
        params
    })
}

// 残损箱查询
export function countDamagedPage(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/damaged/search`,
        params
    })
}

export function countDamagedCount(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/damaged/count`,
        params
    })
}

// 账单查询
export function countBillPage(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/bill/page`,
        params
    })
}

// 下载
export function countBillDownload(id) {
    return fetch({
        method: 'get',
        url: `/customerWeb/down/${id}`,
    })
}

export function indexLoad(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/planStatistics`,
        params
    })
}

export function indexUnload(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/planStatistics`,
        params
    })
}

export function indexDamaged(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/damaged/statistics`,
        params
    })
}

export function indexBill(params) {
    return fetch({
        method: 'get',
        url: `/customerWeb/accounBill/statistics`,
        params
    })
}

export function webDetail(shipPlanNo) {
    return fetch({
        method: 'get',
        url: `/customerWeb/${shipPlanNo}/Detail`,
    })
}

//取消外理封航
export function cancelIceound(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/cancelClose/${id}`,
    })
}


//取消拆提封航
export function lifeSeal(id) {
    return fetch({
        method: 'get',
        url: `/shipPlan/devanCloseCancel/${id}`,
    })
}

//装/卸船理箱-船代统计导出excel
export function ImportExport(params) {
    return fetch({
        method: 'get',
        url: `/report/shipAgentExcel`,
        params
    })
}

// 查询理货人
export function getTallyClerk(params) {
    return fetch({
        method: 'get',
        url: `/jobPerson/getJobPerson`,
        params
    })
}

// 强制理箱完成
export function forceOption(id,data) {
    return fetch({
        method: 'post',
        url: `/boxPlan/forceEndOperation/${id}`,
        data
    })
}

// 根据船名，航次，箱号查找指定的装、拆箱计划
export function getCargoPlan(params) {
    return fetch({
        method: 'get',
        url: `/shipTally/getCargoPlan`,
        params
    })
}

//批量删除箱子
export function batchDelTallyRecord(data) {
    return fetch({
        method: 'post',
        url: `/boxPlan/batchDelTallyRecord`,
        data
    })
}

// 导入
export function createFromExcel(planType, portCode, fileId) {
    return fetch({
        method: 'get',
        url: `/shipPlan/createFromExcel/${planType}/${portCode}/${fileId}`,
    })
}

// 理货作业月报船代统计
export function getMonthShipNameReport(params) {
    return fetch({
        method: 'get',
        url: `/report/report/month/shipName`,
        params
    })
}

// 结算单位作业月报统计
export function getAccountunitsumReport(params) {
    return fetch({
        method: 'get',
        url: `/report/month/accountunitsum`,
        params
    })
}

